<template>
  <div style="width: 100%">
    <swiper  :height="h" :aspect-ratio="2" :list="imgs" loop auto @on-index-change="onSwiperItemIndexChange" dots-class="custom-bottom" dots-position="center">
    </swiper>
  </div>
</template>
<script>
  var MyRequest = require('./../../commons/js/MyRequest.js');
  import { Swiper, SwiperItem, Badge } from './../../components'


//  const urlList = imgList.map((one, index) => ({
//    url: 'javascript:',  //这里填写图片点击的链接
//    img: one
//  }))
  export default {
    data () {
      return {
        swiperItemIndex: 1,
        h:'180px'
      }
    },
    props:{
      imgs:{
        type:Array,
        default () {
          return []
        }
      }
    },
    created: function() {
        var w = $(window).width();
        console.log("屏幕宽度:"+w);
        var h = w/2;
        this.h = h + "px";
    },
    components: {
      Swiper,
      SwiperItem
    },
    methods: {
      onSwiperItemIndexChange (index) {
        this.swiperItemIndex =index;
      },
    }
  }
</script>
<style>
  .vux-icon-dot.active {
    background-color: orange !important;
  }
</style>
